﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace MongoDb.EntityFramework
{
    [ComVisible(true)]
    public abstract class MongoDbBusinessLogic
    {
        public List<T> GetAll<T>() where T : class, new()
        {
            return MongoDbContext.Current.All<T>().ToList();
        }

        public abstract List<T> Find<T>(string keyword) where T : class, new();

        public virtual void Save<T>(T item) where T : class, new()
        {
            MongoDbContext.Current.Add(item);
        }

        public abstract void Delete<T>(T item) where T : class, new();
    }
}